import numpy as np
import matplotlib.pyplot as plt

# 生成x值
x = np.linspace(-np.pi, np.pi, 200)

# 计算y值
y = np.sin(x)

# 绘制曲线
plt.plot(x, y)

# 显示图形
plt.show()
